﻿/*              Copyright(c) 2008 Dave Sexton              *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using DaveSexton.DocToMaml.Maml;

namespace DaveSexton.DocToMaml
{
	internal sealed class ReplaceRule : Rule
	{
		#region Public Properties
		public string Replacement { get; set; }

		public override object Value
		{
			get
			{
				return Replacement;
			}
			set
			{
				Replacement = (string) value;
			}
		}
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="ReplaceRule" /> class.
		/// </summary>
		public ReplaceRule(string match, RuleMatchKind matchKind, string replacement)
			: base(match, matchKind, RuleAction.Replace)
		{
			if (string.IsNullOrEmpty(replacement))
				throw new ArgumentException(Resources.Errors.NullOrEmpty, "replacement");

			Replacement = replacement;
		}
		#endregion
	}
}
